home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dvibook / libtex / bcopy.c < prev    next >
C/C++ Source or Header  |  1994-03-18  |  499b  |  27 lines

  1. #ifndef lint
  2. static char rcsid[] = "$Header: /usr/src/local/tex/local/mctex/lib/RCS/bcopy.c,v 3.1 89/08/22 21:42:07 chris Exp $";
  3. #endif
  4.  
  5. /*
  6.  * Sample bcopy() routine.
  7.  * This should be rewritten to be as fast as possible for your
  8.  * machine.
  9.  */
  10. bcopy(from, to, count)
  11.     register char *from, *to;
  12.     register int count;
  13. {
  14.  
  15.     if (from == to)
  16.         return;
  17.     if (from > to) {
  18.         while (--count >= 0)
  19.             *to++ = *from++;
  20.     } else {
  21.         from += count;
  22.         to += count;
  23.         while (--count >= 0)
  24.             *--to = *--from;
  25.     }
  26. }
  27.